<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>东财个股资金流</title>
		<link href="css/text.css" rel="stylesheet" type="text/css" />
		<style type="text/css">				
			p {margin:0px;}					
			ul {margin:0px;}			
			h4 {margin:0px}				
			#box{
				display:inline-block;
				margin:0px 5px 0px 20px;
				border-box:50%;
				width:10px;
				height:10px;
			}
			#zb{
				 position:absolute;
				 left:200px;
				 margin-top:5px;
			}
			.fixedBox{					
				white-space: nowrap;	
			}
			.fixedBox::-webkit-scrollbar {
				width: 8px;     
				height: 8px;				
			}	
			.main{					
				float:left; 
				width:24%; 
				height:100px;
				margin-left:5px;
				margin-top:-10px;
				border: 0px solid #696969;	
			}
		</style>		
		<script type="text/javascript" src="js/json2html.js"></script>
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/echarts.js"></script>
	</head>
	<body>
		<div id="towrite" class="fixedBox" style="left:0px;width:99%;border: 0px solid #C0C0C0;">  <!-- 调节总宽度 -->
			<div id="title1" style="width:98%;height:20px;"></div>
<div id="chart" style="position:relative;float:left;width:99%;height:188px;margin:-8px 0px 0px -5px; border: 0px solid #808080;"></div><!-- 线大小 -->
<div id="towrite1" class="fixedBox" style="position:relative; float:left;left:0px;width:99%;height:20px;font-size:12px;margin:-10px 0px 0px 0px;border: 0px solid #808080;"></div>
		
<div id="towrite2" class="fixedBox" style="position:relative;float:left;left:40px;top:-188px;width:48%;height:190px;margin:5px 0px 0px -5px; border: 0px solid #808080;"><!-- 柱高度-->
				<div id="title2" style="width:98%;height:20px;"></div>
<div id="main1" style="float:left; width:188px; height:128px;margin:-10px 0px 5px -5px; border: 1px solid #696969;"></div><!-- 柱大小 -->				
				<div id="main2" class="main1" style="width: 1px; height: 1px"></div>




			</div>
		</div>
		<script>
			var cy = "10,15,20,30";  //设置默认统计周期
			var cz = cy.split(",");
			var tc = 10;  //设置默认统计天数
			window.onload = function() {				
				getSource();
			}					
			
			
			window.onresize = function() {				
				ad();				
			}
			
			function ad() {
				var l = document.getElementById('main2').offsetLeft;
				var a1 = document.getElementById('ts' + cz[0]);
				var a2 = document.getElementById('ts' + cz[1]);
				var a3 = document.getElementById('ts' + cz[2]);
				var a4 = document.getElementById('ts' + cz[3]);
				a1.style.left = l + 'px';
				a2.style.left = l + 40 + 'px';
				a3.style.left = l + 80 + 'px';
				a4.style.left = l + 120 + 'px';
			}
			
			$(function() {
				setInterval(function() {									
					getSource();																				
				},
				500);
			})
			
			function time_range(beginTime, endTime) {
				var strb = beginTime.split(":");
				if (strb.length != 2) {
					return false;
				}

				var stre = endTime.split(":");
				if (stre.length != 2) {
					return false;
				}

				var b = new Date();
				var e = new Date();
				var n = new Date();

				b.setHours(strb[0]);
				b.setMinutes(strb[1]);
				e.setHours(stre[0]);
				e.setMinutes(stre[1]);

				if (n.getTime() - b.getTime() > 0 && n.getTime() - e.getTime() < 0) {
					v = 1;								
					console.log(true)　　　　　　
					return true;				
				} else {
					console.log(false)
				    return false;     
				}
			}
			
			//var tc = ts;　　　  　　　						
			function zqqh(i) {
				tc = i;				
				Addzj();
				//var aa = "10,15,20,30";
				var aa = cy;
				var ss = aa.split(",");
				for(var j = 0; j <ss.length; j++){					
					var Obj = document.getElementById('ts' + ss[j]);
					if(ss[j] == i){
						Obj.style.color = "#00FFFF";
					}else{
						Obj.style.color = "#fff";
					}
					
				}
				
			}
			
			var z = 0;  //刷新
			var v = 0;	//刷新		
			var gpdm = "";
			var gpmc = "";	
			var jlr = "";
			var res = [];
			function getSource() {			
				var u = decodeURI(window.location.href);								
				if(u.indexOf("##") > -1){
					var gp = u.split('##');				
					dm = gp[1];
					gpmc = gp[2];															
				}else{
					dm = "600000";
					gpmc = "浦发银行";					
				}
								
				if(dm != gpdm || v == 1){				
					v = 0;					
					gpdm = dm;					
					var dms = "";
					var dmt = "";
					if(dm.substr(0,1)=="6"){
						dms = "SH" + dm;
						dmt = "1." + dm;
					}else{
						dms = "SZ" + dm;
						dmt = "0." + dm;
					}
					
					var div1 = document.getElementById('title1');
					var div2 = document.getElementById('title2');						
					var back = '<a href="javascript:back();"  style="position:absolute; left:20px;color:#fff;">←</a>';					
					var forward = '<a href="javascript:forward(1);"  style="position:absolute; left:50px;color:#fff;">→</a>';
					var clear = '<a href="javascript:forward(0);"  style="position:absolute; left:80px;color:#fff;font-size:12px;">今</a>';
var tja = '<a href="javascript:zqqh(' + cz[0] + ');" id="ts' + cz[0] + '" style="position:absolute;color:#fff;font-size:12px;">' +  '</a>';					
var tjb = '<a href="javascript:zqqh(' + cz[1] + ');" id="ts' + cz[1] + '" style="position:absolute;color:#fff;font-size:12px;">' +  '</a>'
var tjc = '<a href="javascript:zqqh(' + cz[2] + ');" id="ts' + cz[2] + '" style="position:absolute;color:#fff;font-size:12px;">' +  '</a>'
var tjd = '<a href="javascript:zqqh(' + cz[3] + ');" id="ts' + cz[3] + '" style="position:absolute;color:#fff;font-size:12px;">'  + '</a>'
					
									
					div1.innerHTML = '<font size="2">' + gpdm + "&nbsp;&nbsp;&nbsp;" + gpmc + "</font>";
					div2.innerHTML = '<font size="3">' + back + forward + clear + tja + tjb + tjc + tjd + "</font>";
					
					ad();
					var Obj = document.getElementById('ts' + tc);				
					Obj.style.color = "#00FFFF";
				
					t = 0;					
					var url1 = "https://push2.eastmoney.com/api/qt/stock/fflow/kline/get?cb=jQuery1123016706401424591832_1668777335401&lmt=0&klt=1&fields1=f1,f2,f3,f7&fields2=f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61,f62,f63,f64,f65&ut=b2884a393a59ad64002292a3e90d46a5&secid=" + dmt; 
					var res1 = [];
					$.ajax({
						type: "get",
						url: url1,
						dataType: "text",
						async : false,
						cache:false,
						timeout:3000,					
						success: function(data) {
							//alert(JSON.stringify(data))						
							//document.write(data);							
							var ss = data.replace(/ /g,",")
							ss = ss.match(/,"klines":(\S*)}}\);/)[1];							
							var arr =  JSON.parse(ss);								
							for (var i = 0; i < arr.length; i++){							
								var aa = arr[i].split(',');
								if(i == 0){
									rq = aa[0];								
								}
								var rc = {"rq":aa[0],"time":aa[1],"zljlr":aa[2],"xdjlr":aa[3],"zdjlr":aa[4],"ddjlr":aa[5],"cddjlr":aa[6]};
								res1.push(rc);
							}															
						}
					});
					var url2 = "http://push2.eastmoney.com/api/qt/ulist.np/get?cb=jQuery1123022062381139471432_1633842668576&fltt=2&secids=" + dmt +"&fields=f62,f184,f66,f69,f72,f75,f78,f81,f84,f87,f164";																
					var res2 = [];
					$.ajax({
						type: "get",
						url: url2,
						dataType: "text",
						async : false,
						cache:false,
						timeout:3000,					
						success: function(data) {
							//alert(JSON.stringify(data))						
							//document.write(data);														
							var ss = data.match(/,"diff":(\S*)}}\);/)[1];							
							res2 = JSON.parse(ss);							
						}
					});
					
					var url3 = "https://push2his.eastmoney.com/api/qt/stock/fflow/daykline/get?cb=jQuery112309685262356049713_1661657886677&lmt=0&klt=101&fields1=f1,f2,f3,f7&fields2=f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61,f62,f63,f64,f65&secid=" + dmt;
					var res3 = [];
					var rq3 = "";
					$.ajax({
						type: "get",
						url: url3,
						dataType: "text",
						async : false,
						cache:false,
						timeout:3000,					
						success: function(data) {
							//alert(JSON.stringify(data))						
							//document.write(data);														
							var ss = data.replace(/ /g,",")
							ss = ss.match(/,"klines":(\S*)}}\);/)[1];							
							res3 = JSON.parse(ss);
							if(res3.length > 0){
								rq3 = res3[res3.length-1].split(',')[0];
							}
						}
					});
					
					
		
					<!-- //资金统计	 -->
					var zljlr = res2[0]["f62"];
					var zljb = res2[0]["f184"];					
					var cddjlr = res2[0]["f66"];
					var cddjb = res2[0]["f69"];					
					var ddjlr = res2[0]["f72"];
					var ddjb = res2[0]["f75"];					
					var zdjlr = res2[0]["f78"];
					var zdjb = res2[0]["f81"];					
					var xdjlr = res2[0]["f84"];
					var xdjb = res2[0]["f87"];
					
					var a1 = '<span id="box" style="background-color:#FF0000"></span>';
					var a2 = '<span id="box" style="background-color:#FF00FF"></span>';
					var a3 = '<span id="box" style="background-color:#FFA500"></span>';
					var a4 = '<span id="box" style="background-color:#00BFFF"></span>';
					var a5 = '<span id="box" style="background-color:#00FF00"></span>';
					var html = a1 + "<font>主力净比：<font>" + zljb + "%</font></font>" +					
					a2 + "<font>超大单净比：<font>" + cddjb +  "%</font></font>" + 
					a3 + "<font>大单净比：<font>" + ddjb +  "%</font></font>" + 
					a4 + "<font>中单净比：<font>" + zdjb +  "%</font></font>" + 
					a5 + "<font>小单净比：<font>" + xdjb +  "%</font></font>";
					
					jlr = ',主力净流入:' + NumberTransform(zljlr) +
						',超大单净流入:' + NumberTransform(cddjlr) + 
						',大单净流入:' + NumberTransform(ddjlr) +
						',中单净流入:' + NumberTransform(zdjlr) +
						',小单净流入:' + NumberTransform(xdjlr) + ',';
					
					//分时资金
					if(res1.length > 0){
						GetChart1(res1);
					}
					
					var div = document.getElementById('towrite1');	
					div.innerHTML = html;
					change();	
					
					//历史交易日资金
					res = [];					
					if(rq == "" || rq == rq3){
						res = res3;
					}else{
						var rs = '"' + rq + "," + zljlr + "," + xdjlr + "," + zdjlr + "," + ddjlr + "," + cddjlr + "," + zljb + "," + xdjb + "," + zdjb + "," + ddjb + "," + cddjb + '"';
						res = res3.concat(JSON.parse(rs));
					}
					//document.write(JSON.stringify(res));
					
					var aa = res[res.length - 1].split(',');
					var bt = aa[0];
					var zljlr = aa[1];
					var cddjlr = aa[5];
					var ddjlr = aa[4];
					var zdjlr = aa[3];
					var xdjlr = aa[2];
					var datas = [];
					datas.push(zljlr,cddjlr,ddjlr,zdjlr,xdjlr);
						
					GetChart("main1", datas, bt);					
					Addzj();
				}else{
					z++;
					if(z == 60){
						z = 0;
						time_range("9:00","15:15")  //刷新数据
					}
				}
			}
			
			var t = 0;
			function back() {				
				var n = res.length;				
				var m = n - t - 2;
				if(m >= 0){
					var aa = res[m].split(',');
					var bt = aa[0];
					var zljlr = aa[1];
					var cddjlr = aa[5];
					var ddjlr = aa[4];
					var zdjlr = aa[3];
					var xdjlr = aa[2];
					var datas = [];
					datas.push(zljlr,cddjlr,ddjlr,zdjlr,xdjlr);					
					GetChart("main1", datas, bt);
					t++;
					Addzj();
				}
			}
			
			function forward(p) {
				if( p == 0){
					t = 1;
				}				
				var n = res.length;				
				var m = n - t;				
				if(m < 102){
					var aa = res[m].split(',');
					var bt = aa[0];
					var zljlr = aa[1];
					var cddjlr = aa[5];
					var ddjlr = aa[4];
					var zdjlr = aa[3];
					var xdjlr = aa[2];
					var datas = [];
					datas.push(zljlr,cddjlr,ddjlr,zdjlr,xdjlr);					
					GetChart("main1", datas, bt);
					t--;
					Addzj();
				}				
			}			
			
			var datas1 = [];
			var datas2 = [];
			var datas3 = [];
			var datas4 = [];
			var datas5 = [];	
			var rqs = [];			
			function Addzj() {
				datas1 = [];
				datas2 = [];
				datas3 = [];
				datas4 = [];
				datas5 = [];
				rqs = [];
				var n = 0;
				var a = 0;
				var b = 0;
				var c = 0;
				var d = 0;
				var e = 0;
				var end = res.length - 1;
				var p = res.length - t;
				if(p > 0){
					if(p >= tc){
						p = tc;						
					}
					for(var i = end - t; i >= res.length - t - p; i--){											
						n++;									
						var aa = res[i].split(',');
						var bt = aa[0];
						var zljlr = aa[1];
						var cddjlr = aa[5];
						var ddjlr = aa[4];
						var zdjlr = aa[3];
						var xdjlr = aa[2];		
						a += Number(zljlr);	
						b += Number(cddjlr);
						c += Number(ddjlr);
						d += Number(zdjlr);
						e += Number(xdjlr);
						datas1.push(NumberTrans(a));
						datas2.push(NumberTrans(b));
						datas3.push(NumberTrans(c));
						datas4.push(NumberTrans(d));
						datas5.push(NumberTrans(e));						
					}
					
					for(var i = 1; i <= p; i++){
						rqs.push(i + "日");
					}
					//alert(JSON.stringify(rqs));
					
					GetChart2("main2" ,datas1, '主力');	
					GetChart2("main3" ,datas2, '超大单');
					GetChart2("main4" ,datas3, '大单');
					GetChart2("main5" ,datas4, '中单');
					GetChart2("main6" ,datas5, '小单');	
				}				
			}
			
			
			function NumberTransform(num) { 
				var result = num;
               if(Math.abs(num) > 100000000){
			    result = num / 100000000;
				result = result.toFixed(2) + "亿";
			   }else if(Math.abs(num) > 10000){
			    result = num/10000;
				result = result.toFixed(0) + "万";
			   }				   
               return result;  
			};			
			
			function NumberTrans(num) { 
				var result = num;               
			    result = num/10000;
				result = result.toFixed(0);			   				  
               return Number(result);  
			};
						
			function NumberTransl(num) { 
				var result = num;
				if(Math.abs(num) > 10000){
					result = num / 10000;
					result = result.toFixed(2) + "亿";
				}else{					
					result = result.toFixed(0) + "万";
				}				   
				return result;  
			};
			
			function change() {
				var div = document.getElementById('towrite1');
				var items = div.getElementsByTagName("font"); 
				for ( var i = 0; i < items.length; i++)
				{
					var obj = items[i];
					var num = parseFloat (obj.firstChild.nodeValue);
					//obj.style.color = num > 0 ? "Orange" : "Lime";					
					obj.style.color = num > 0 ? "Orange" : (num < 0 ? "Lime" : "#E5E5E5");					
				}							
			};
			
			function getParamValues(name, arr) {
				var ret = []
				//var len = arr.length;				
				for (var i = 0; i < 240; i++) {
					if(arr[i] != undefined){
						ret.push(arr[i][name])
					}else{
						ret.push(null)
					}
				}				
				return ret
			}
		</script>
		
		<script>
			function GetChart(id, datas, bt) {
				var json = datas;
				var myChart = echarts.init(document.getElementById(id));
				
				var option = {
						title:{
							 left:'right',
							text: bt + ' ',
							textStyle:{ //设置主标题风格
								color:'#FFFF00',//设置主标题字体颜色
								fontStyle:'normal',//主标题文字风格
								fontSize: 12
							}
						},
						<!-- tooltip: {   //提示框 -->
							<!-- trigger: 'axis',  //当trigger为’item’时只会显示该点的数据，为’axis’时显示该列下所有坐标轴所对应的数据。 -->
							<!-- axisPointer: { -->
								<!-- type: 'line', // 指示器类型（'line' 直线指示器；'shadow' 阴影指示器；'none' 无指示器；'cross' 十字准星指示器。）								 -->
								<!-- crossStyle: { -->
									<!-- color: '#fff' -->
								<!-- } -->
							<!-- }, -->
							<!-- textStyle:{ 								 -->
								<!-- fontSize: 12 -->
							<!-- }, -->
							<!-- formatter: function (params) { -->
							 <!-- var a = params[0].name  //表示x轴数据 -->
							 <!-- var b = params[0].value //表示y轴数据 -->
							 <!-- return NumberTransform(b);							  -->
							 <!-- return str -->
						   <!-- }, -->
						<!-- }, -->

						<!-- legend: {  //图例 -->
							<!-- show:false -->
						<!-- }, -->
						grid: { // 边距
						  left: '5px',
						  right: '1%',
						  bottom: '30%',
						  top: '20%',
						  //containLabel: true  //grid 区域是否包含坐标轴的刻度标签
						},
        
						xAxis: [				  
							{
								type: 'category',								
								data: ['主力', '超单', '大单', '中单', '小单'], // 从原始数据中提取个数组出来
								axisLine:{
									lineStyle:{//改变xy轴线条的颜色
										color:"#696969",
										//width:1
									}
								},
								axisLabel:{									
									//rotate:45，//倾斜45°
									formatter:function(value){   //文字竖直显示
										return value.split("").join("\n");
									}, 
									textStyle:{//改变xy轴上文字的颜色
										color:"#FFF",
										fontSize: 12
									}
								},
								axisPointer: {
									type: 'shadow'
								}
							}
						],

						yAxis: [
							{
								type: 'value',								
								splitLine:{ //网格线
									show:false
								},
								axisLabel: {
									formatter: '{value} 万'
								}
							},
						],

						series: [
							{
								name: '净流入',
								type: 'bar',
								barGap: 0,
								//barCategoryGap:'50%',
								barWidth: 30, // 柱图宽度
								
								label: {   //数值显示
									normal: {
										
									  show: true,//开启显示
									  position: 'top',//柱形上方
									  formatter:function(param){   //文字竖直显示									  
										var c = param.value;								  
										return NumberTransform(c);
										}, 
									  textStyle: { //数值样式
										color: '#fff',
										fontSize: 10
									  }
									}
								},
								
								itemStyle:{
									normal: {								
										color: function (params) { //根据数值大小设置相关颜色
											if (params.value > 0) {
												return 'red'
											} else {
												return 'Chartreuse'
											}
										}
									}
								},
								data: json
							}
						]
					};
		 
					myChart.setOption(option);
			}
		</script>
		
		<script>
			function GetChart2(id ,datas, bt) {				
				var json = datas;					
				var myChart = echarts.init(document.getElementById(id));
				
				var option = {
						title:{
							 left:'right',
							text: tc + '日' + bt + '资金流向',
							textStyle:{ //设置主标题风格
								color:'#FFFF00',//设置主标题字体颜色
								fontStyle:'normal',//主标题文字风格
								fontSize: 12
							}
						},
						tooltip: {   //提示框
							trigger: 'axis',
							axisPointer: {
								type: 'cross',
								label: {
									formatter: function (params) {	
										if(params.value.toString().indexOf("日") > -1){
											return params.value
										}else if(params.value != "null"){
											return NumberTransl(params.value)
										}								
									},
									backgroundColor: '#000'
								},
								crossStyle: {
									color: '#fff'
								}
							},
							textStyle:{ 								
								fontSize: 12
							},
							formatter(params) {  //添加文字
								if(params[0].name != "null"){
									var str = params[0].name + '<br />'						  
									params.forEach(item => {	
										if(item.seriesName!="line"){
											str += '<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;left:5px;background-color:' + item.color + '"></span>' + item.seriesName + " : " + NumberTransl(item.data) + "<br />";
										}
									})
									return str;
								}
							}
						},

						<!-- legend: {  //图例 -->
							<!-- show:false -->
						<!-- }, -->
						grid: { // 边距
						  left: '5px',
						  right: '5%',
						  bottom: '30%',
						  top: '25%',
						  //containLabel: true  //grid 区域是否包含坐标轴的刻度标签
						},
        
						xAxis: [		//x轴设置		  
							{
								type: 'category',								
								//data: ['1日','2日','3日','4日','5日','6日','7日','8日','9日','10日'],
								data: rqs,
								axisLine:{  //x轴坐标线设置
									lineStyle:{
										color:"#D3D3D3",  //x轴坐标线颜色
										width: 2   // 坐标轴线宽
									}
								},
								axisTick: {   //x轴刻度
									show:false, 
								},
								axisLabel:{	 //x轴标签设置						
									//rotate:45，//倾斜45°
									<!-- formatter:function(value){ -->
										<!-- return value + "日"; -->
									<!-- },  -->
									textStyle:{  //x轴文字
										color:"#FFF"
									}
								},
								axisPointer: {
									type: 'shadow'
								}
							}
						],

						yAxis: [  //y轴
							{
								type: 'value',
								min: function(value) {//取最小值向下取整为最小刻度									
									return Math.floor(value.min)
								},
								max: function(value) {//取最大值向上取整为最大刻度
									if(value.max < 0){
										return  0 
									}else{
										return  Math.ceil(value.max) 
									}									
								},
								interval: function (value) { // 刻度间隔
									if(value.max < 0){
										return  Math.ceil(value.min) 
									}else{
										return  Math.ceil(value.max)
									}									
								},								
								splitLine:{ //y轴网格线									
									show:true,
									lineStyle: { 									
										color: '#D3D3D3', 
										width: 1,    
										type: 'dotted', //（'solid'，实线类型；'dashed'，虚线类型；'dotted',点状类型）
									} 
								},
								axisLine: { //y轴坐标线设置
									show: true, 									
									lineStyle: { 									
										color: '#D3D3D3', //y轴颜色
										width: 2,    // 坐标轴线宽
										type: 'solid',     // 坐标轴线线的类型（'solid'，实线类型；'dashed'，虚线类型；'dotted',点状类型）
									} 
								},
								axisTick: {   //y轴刻度
									show:false, 
								},
								axisLabel: {  //y轴标签设置
									show: true,
									color: '#fff',									
									formatter: function (value){
										if(value != 0){							  
											return NumberTransl(value)
										}else{
											return 0
										}
									}
								}
							},
						],
						
						series: [
							{
								name: bt,
								type: 'bar',
								//barGap: 0,
								//barCategoryGap:'50%',
								barWidth: 10, // 柱图宽度								
								itemStyle:{
									normal: {								
										color: function (params) { //根据数值大小设置相关颜色
											if (params.value > 0) {
												return 'red'
											} else {
												return 'Chartreuse'
											}
										}
									}
								},
								data: json
							},							
							{
								name: "line",
								data: json,
								type: 'line',								
								//symbol: 'circle',//拐点样式
								//symbolSize: 18,//拐点大小
								itemStyle: {
								  normal: {
									lineStyle: {
									  width: 2,//折线宽度
									  color: "#FFA500"//折线颜色
									},
									color: '#27dba0',//拐点颜色
									borderColor: '#fff',//拐点边框颜色
									borderWidth: 1//拐点边框大小
								  },
								  emphasis: {
									color: '#4CCEFE'//hover拐点颜色定义
								  }
								},
							}
						]
					}					
					myChart.setOption(option);
			}
		</script>
		
		<script>
			function GetChart1(arr) {
				var myChart = echarts.init(document.getElementById('chart'));
				
				var option = {
					title:{
						left:'left',						
						//text: '实时资金流向',
						textStyle:{ //设置主标题风格
							color:'#FFFF00',//设置主标题字体颜色
							fontStyle:'normal',//主标题文字风格
							fontSize: 14
						}
					},
					tooltip: {   //提示框
						trigger: 'axis',						
						axisPointer: {
							type: 'cross',
							label: {
								formatter: function (params) {									
									<!-- if(params.value != "null"){ -->
										<!-- return params.value -->
									<!-- } -->
									if(params.value.toString().indexOf(":") > -1){
										return params.value
									}else if(params.value != "null"){
										return NumberTransform(params.value)
									}
								},
								backgroundColor: '#000'
							},
							crossStyle: {								
								textStyle:{ 
									color: '#fff'									
								}
							},							 
						},	
						textStyle:{ 								
							fontSize: 12
						},
						formatter(params) {  //添加文字
							if(params[0].name != "null"){
								var str = params[0].name + '<br />'						  
								params.forEach(item => {																							
									str += '<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;left:5px;background-color:' + item.color + '"></span>' + item.seriesName + " : " + NumberTransform(item.data) + "<br />";
								})
								return str;
							}
						}
					},						
					grid: { // 边距
					  left: '13px',
					  right: '5%',
					  bottom: '10%',
					  top: '10%',
					  //containLabel: true  //grid 区域是否包含坐标轴的刻度标签
					},
					legend: {   // 图例
						show: true,
						orient: 'horizontal',  //布局 默认横向布局'horizontal'，纵向布局’vertical’
						//x:'left',
						//y:'top',						
						type: "plain", // 图例的类型 'plain':普通图例  'scroll':可滚动翻页的图例
						zlevel: 1, // 所有图形的 zlevel 值。
						icon: "circle",  //控制形状  类型包括 circle 圆形，triangle 三角形，diamond 四边形，arrow 变异三角形，none 无
						top: "0%", // bottom:"20%" // 组件离容器的距离
						left: "1%", //left:"10%"  // // 组件离容器的距离         
						padding: 5, // 图例内边距	
						align: "auto", // 图例标记和文本的对齐
						itemGap: 30, // 图例每项之间的间隔。
						itemWidth: 15,     // 图例标记的图形宽度
						itemHeight: 12,      // 图例标记的图形高度// 使用字符串模板，模板变量为图例名称 {name}	
						formatter: function (item) {
							return item.substr(0,2) + jlr.split("," + item)[1].split(",")[0]
						},
						textStyle: {
							color: "#fff", // 文字的颜色。								
						}
					},					
					xAxis: [		//x轴设置		  
						{
							type: 'category',								
							data: getParamValues('time', arr),							
							axisLine:{  //x轴坐标线设置
								lineStyle:{
									color:"#D3D3D3",  //x轴坐标线颜色
									width: 0   // 坐标轴线宽
								}
							},
							axisTick: {   //x轴刻度
								show:false, 
							},
							axisLabel:{	 //x轴标签设置	
								interval: 0,
								formatter: function (value, index) {									
									 if(value=="09:31" || value=="10:30" || value=="11:30" || value=="14:00" || value=="15:00"){
										return value
									 }
								 },
								textStyle:{  //x轴文字
									color:"#FFF"
								}
							},
							axisPointer: {
								type: 'shadow',								
							}
						}
					],

					yAxis: [  //y轴
						{
							type: 'value',
							min: function(value) {//取最小值向下取整为最小刻度									
								return Math.floor(value.min)
							},
							max: function(value) {//取最大值向上取整为最大刻度
								if(value.max < 0){
									return  0 
								}else{
									return  Math.ceil(value.max) 
								}									
							},
							interval: function (value) { // 刻度间隔
								if(value.max < 0){
									return  Math.ceil(value.min) 
								}else{
									return  Math.ceil(value.max)
								}									
							},								
							splitLine:{ //y轴网格线									
								show:true,
								lineStyle: { 									
									color: '#D3D3D3', 
									width: 1,    
									type: 'dotted', //（'solid'，实线类型；'dashed'，虚线类型；'dotted',点状类型）
								} 
							},
							axisLine: { //y轴坐标线设置
								show: true, 									
								lineStyle: { 									
									color: '#D3D3D3', //y轴颜色
									width: 1,    // 坐标轴线宽
									type: 'solid',     // 坐标轴线线的类型（'solid'，实线类型；'dashed'，虚线类型；'dotted',点状类型）
								} 
							},
							axisTick: {   //y轴刻度
								show:false, 
							},
							axisLabel: {  //y轴标签设置
								show: false,
								color: '#fff',									
								formatter: function (value){
									if(value != 0){							  
										return NumberTransform(value)
									}else{
										return 0
									}
								}
							}
						},
					],					
					series: [						
						{							
							name: '主力净流入',
							data: getParamValues('zljlr', arr),							
							type: 'line',								
							symbol: 'circle',//拐点样式‘circle’, ‘rect’, ‘roundRect’, ‘triangle’, ‘diamond’, ‘pin’, ‘arrow’ 
							symbolSize: 0,//拐点大小							
							itemStyle: {
							  normal: {
								lineStyle: {
								  width: 2,//折线宽度
								  color: "#FF0000"//折线颜色
								},
								color: '#FF0000',//拐点颜色
								borderColor: '#fff',//拐点边框颜色
								//borderWidth: 1,//拐点边框大小
							  },
							  emphasis: {  //hover设置，不设置可跟随前面定义
								//color: '#FF0000',//hover拐点颜色定义								
								//borderColor: '#fff',//hover拐点边框颜色
								//borderWidth: 1,//hover拐点边框大小
							  }
							},
						},
						{
							name: '超大单净流入',
							data: getParamValues('cddjlr', arr),
							type: 'line',								
							symbolSize: 0,
							itemStyle: {
							  normal: {
								lineStyle: {
								  width: 1,
								  color: "#FF00FF"
								},
								color: "#FF00FF",
							  },
							  emphasis: {
								color: '#FF00FF'
							  }
							},
						},
						{
							name: '大单净流入',
							data: getParamValues('ddjlr', arr),
							type: 'line',								
							symbolSize: 0,
							itemStyle: {
							  normal: {
								lineStyle: {
								  width: 1,
								  color: "#FFA500"
								},
								color: "#FFA500",
							  },
							  emphasis: {
								color: '#FFA500'
							  }
							},
						},
						{
							name: '中单净流入',
							data: getParamValues('zdjlr', arr),
							type: 'line',								
							symbolSize: 0,
							itemStyle: {
							  normal: {
								lineStyle: {
								  width: 1,
								  color: "#00BFFF"
								},
								color: "#00BFFF",
							  },
							  emphasis: {
								color: '#00BFFF'
							  }
							},
						},
						{
							name: '小单净流入',
							data: getParamValues('xdjlr', arr),
							type: 'line',								
							symbolSize: 1,
							itemStyle: {
							  normal: {
								lineStyle: {
								  width: 1,
								  color: "#00FF00"
								},
								color: "#00FF00",
							  },
							  emphasis: {
								color: '#00FF00'//hover拐点颜色定义
							  }
							},
						}
					]
				}					
				myChart.setOption(option);
			}
		</script>
	</body>
</html>